Adjusted implementation following code review