much cleaner with this approach