move deref up so it can be optimized