Change options to config and improve