Redesign stdin buffer initiallisation