Refactor entity updates and player movement