refactored to use variable