Refactoring Code

I had refactoring code.
Please review this.