cleaner logic and less repeating