Update following Trishank's initial code review