Finished work on the refactoring

Please review my code