re-arrange code for better arg handling.
add utility class