Made main class take external config optionally.