close some TODO
improve argument validation