Add factory girl

Added factory girl and refactored code so that it uses factory girl.
Line is too long. [84/80]