Code style changes. Refactored some functions.