Cleaned up code and moved some resources