Cleanup: use subs, not str/join + take, to get substring