Refactor a method