Cleaned up various code bits