Cleaning up more functions