Refactored the production and test class