Moved Railtie initialization into a method