Cleaned up whitespace and added helper method