Make code more readable, applied formatting and fixed imports