Niceified the code