Handle flags in a more uniform way
Handling for more ets operations
Some more dependencies
Simplify scheduler code