cleaned up the code even more