Adding user on/off logic and removing unused code