refactored out classes