code refactoring done.