Work on #32: Refactor base and entity classes