add commnent and refactor