refactor in line with Adapt coding standards
Finish code refactor to contrib standards