Refactoring and finalization of Handler functions
merge