Clean up the code. See #54