functional tests refactoring

Change-Id: Ia58d828ecd02ee22acd4e21cf83009108ec86e1e