automap refactor