move logic around