Refac for cleaner code