Refactored class structure