separating functionality a little