Swapped duck typing check in favour of instanceof