Moved common test functions into once place