refactoring variable usage