DRY and cleanups