player movement code clean up