more refactor and cleanup.