a few simplifications and one bugfix (bug with hardcoded input name)