Cleaned the code a tad