refactoring here and there.