This one will be done in #41, since they share some code and to avoid merge conflicts I'm not sending 2 PR's in parallel.