Refactoring of multiple method