Some Refactoring and Modification