cleaned up flow