refactoring compute pose update as function