added factory girl and refactored