Refactored to prepare for update