Remove key switching from boilerplate and move to utils