refactor class structure to be extensible