Clean-up
Split tag mapping and line reporting into different functions