Refactoring some few sections of functional tests.