simplified input parser code