refactor vmapp for getopt