Refactored to separate data from views