Used lambdas where possible and replaced direct class references with imports