rework based on conv. with @peterflynn