Getting rid of instanceof :)