refactored code to have better naming