Changed variable names in factory