Refactor to use fragments