organization update: added/edited/fixed comments, rearranged utility methods