fix custom rake tasks
refactor tests