Refactor and comment params and router