updating the code to follow the pattern.