Reworked factory to use WP core cache stuff