Tests refactored merge

Tested in my local environment and micro-qa.