rewrite a lot
more readable ?