Divided stuff into logical(?) parts