Refactoring: improve typing

We should track every place where we are using the <Any> or where we are explicitely ignoring type checks to replace with proper typing specifications.

I.E. There could be locations where the type of objects returned is actually unknown. But first, identify them, fix what we can.

Edited by Benoit Alessandroni