Fixes from review, better names and internal code documentation.