Trying to clean up and make idempotent