These two lines look similar. Maybe we can move it to separate method?