bunch of improvements in emr and tool