Refactoring & Test added.