Code clean-up and fixed white-space formatting