move startup logic to better file