refactored specs for more flexibility