clean up test and added more validations