more refactoring

plan to watching this ver for a while.