Much cleaner code