Improved inline docs and organised a bit