refactor spec_helper

some refactoring and code gardening