define classes as self invoking functions