split logic from ui