refactor, cleanup, arg check on startup