refactor to move merge function to model, also got most of specs done. just one pending