Clean up and reduced function use

See title