refactored for php. support page.