refactore hierarchy to auto require in rails