Cleaned up some formatting, declared method arguments 'final', and updated some deprecated methods.