First pass according to @mglukhovsky's comments