basic repository pattern implemented for controllers