some code style refactor; fix rake task