Modified code so to use Map/ List instead of more specific objects