It would be nice to break this into a separate file, and name according to WP coding standards.