simple cleanup of order of operations; needs more work