Move populate from apps to lib