Added factory functionality for test automation