added better config file support