extracted methods, organized code and variables a bit.  No change to functionality.