Simplfied ensure() code