Did some refactoring of code related to testing and introduced some flag variables to make it easier to run specific tests