Please find an elegant way to deal with input and such.