Code clean up and refactoring. Added support for sections.