load data on init load, code refactor