Refactoring again based on testing #16