Rewriting a lot of internal stuff