Add map + refactor tests a bit