split logic from content into model and controller