refactor pos