Type matching using Equals :(