perform code-style refactoring

- Remove code which is commented out
- Fix whitespace
- Only allow `{` on a single line for function definitions.
refactor complex timeslot-boolean into function.