refactor argument processing with hashtable