Cleaned up code, populate functions work in background