small refactoring
refactoring from event-based to mvc. only compiles. Doesn't work.