move some functionality into components