code cleanup

Added missing semicolons, removed excess colons, clean-code based
rearrangement.