first bunch of mapping framework, still needs tests