Rest of the code refactored to comply with the coding standard.