improved parsing of arguments