A lot of changes, too lazy to split into small commits