Finished cleaning up code