Added scopes and cleanup rake