entry class, with key function