While working on the other issues I noticed various lines in the code that could be cleaned up or refactored.