fix interface/inheritance check mixup
move Map.Entry into inner class
inline classes