Code refinement - no added functionality

Updated semantics, reduced line-count. Removed unnecessary code/comments