Move some extra stuff to logic.