refactored function for running specs