Cleanup code a bit