Added comment, removed redoundant conditonal statement, and added more
explicit null checking.