implemented code review suggestions