refactored admin posts controller