started to remove logic from controllers