refactored val declaration