moved code to gem