Simplified some code

Made easier to read