Refactoring and call direct function