A few convenience functions

Added a couple of convenience accessors and reformatted the code a little, just a line over each function as I find it really helpful when reading code, am happy to remove them and resubmit the PR if you don't want them in your code.