Refactor Position and included a Junit Test