add comment and refantoring