Refactor common position code to parent class.