Logic moved to separate "shared" module