Refactored and introduced specs for factories