refactored to use logic tests instead