refactored some vars