Refactor app disabled check to service

- centralize loop that checks if an app is disabled
- fix style for conditionals

#475