add built-in json4s field mapping and do code refactoring