Trim down code to be Rails 3.0 compatible.