cleaning up objective functions