Rake install task's code refactoring