General clean up; added fancier argument handling.