Improvements based on Codacy review