Updated after code review