implemented John Resig class inheritance pattern