Refactor an modularise base classes