Added new way to register classes
Cleanedup some code
And cookies