simplify apache plugin code