Move toggle side button logic into a module