add Stopwatch class, begin refactoring