fix some issues, finish cleanup a bit more