Remove unnecessary _this = this assignments.
Refactor utility methods and add tests.