added new function, refactoring
refactoring
refactoring and new function to improve