minor code improvements

- added class_exists() checks
- changed class/function names to apply to coding conventions