add dividend history fetching + refactor

Things are starting to look ugly, sometimes I feel the pain of not having
generics...