improvements wrt speed