#135 move abstract class to middleware package