make scroll code easier to read