Cleaned up some code for Codacy