Refactored to avoid manipulating internal var