Moved key aliasing logic into entity