Moved scroll expanded module to its own function.