cleaned up key parsing and removed unused keys