Splitting 2 methos for ui and data init