Implemented an OO version with Moo