refactoring 1 and 2, progress on 3