Refactors code, fixes CodePro audits, adds a test,  makes it perty