add meta functions, refactor class declaration