refacto abstract entity controller