refacot the relocation code to be groovy