refactor to use bookshelf