Move the enter/leave logic into methods so the method can return a const vector which isn't to be manipulated from other functions.
Move the enter/leave logic into methods so the method can return a const vector which isn't to be manipulated from other functions.