cleaner code, I think