refactor render method and package