Refactor/8

@lvivier @switters Take a quick look