refactor posts controller to separate find post method