cleaning up the code, making it easier to read