Cleaned up code.
Lotsa tweaks for WP app