Reworking code to improve readability and meet coding standards; refs #7