Duplication in infinte scroll and init functions