Clean up the code a bit

Remove some unused code, too.