refactored layers to interface, implemented basic entity