Refactored to use fragments