method refactor