modified naming and refactoring