fix some warnings
remove code duplication
try to run emma coverage again