more progress
more refactoring