scope

refactored code to use