Code refactoring and implementation of WordPress style guidelines, fix #17