Refactor FastCgi class.