more refactoring, cleaner setPosition