better use of standard wordpress functions