major refactoring: split classes to files, added metaprogrammed class method, add tier registry