refactoring code

Right. Thanks!