refactoring not completed. Errors to be resolved