Added classes functionality
Refactored code by WP coding standards.