Cleaned up PHP, trying to clean up JS