Cleaned up dirty code.