Improved Test generator