Refactor two fragments into one with style option