Refactored to use views