Simplify task sorting
Improve naming