rearrange everything to avoid implicit definitions