Refactoring and update Rails to version 3.2.12