ref: moved ui logic out of core