added argument
refactored code