Clean up and make less complicated