[experimental!] introduce getops & code cleanup