refactored html and php