Cleaned up code and moved stuff.