Logic to models and controller was added