refactored more.