Added manager, and cleaned up the codebase