Add ControlsState, small fixes, refactoring