Cleanup

Shortened code by combining or rewriting code