create an interface for Spaces and implement it in BinarySpace
redefine BinarySpace not as a nested class but as a separate class