Extracted different methods whre necessary