Replace hardcoded class references

Replaced with classmethods.
Merge pull request #1 from everilae/master

Replace hardcoded class references