replace manual mapping code with automapper