improve testing of stage var, and cleanup test config