update code according to the guidelines