refactoring classes for production use