restructured input checks