updated as per PR comments