split logic and view