Refactoring of Functions