refactoring plus first version of feature weight visualizer for EM