Separating and cleaning up PHP/HTML