Fixed update glitch and refactoring