added some helpers to made the code more readable, i'm sure there's stil...

...l some things that can be done.