Complete Rake refactor