Refactor location of code