Refactored init procedure. Improved test coverage and resolved identified defects.