Some comments and more concise code