trying to dispatch on polymorphic type. completely broken the code. needs a drastic refactoring
fix README