clean code and add comment