refactored/rearranged classes