Restructure things to be functor-oriented.