some updates.
some refactoring.