added code for refactoring