Applied comments!
Moved decode_entry to common place.