Remove old code

Closes #1049