refactor continues...