moved most of the work to the base fragment to allow for more flexibitiy