Refactor: scheduler: parse boolean operator into an enum
This reduces duplication and allows for unit testing.