refactor and #38