refactor relativisation code