adding config file and improving processing