created methods in models, made controller thinner.