Refactor code to display no activities msg on stats page