Some clean-ups.

* removed pylab import.
* some pep8 fixes.
* removed implicit imports to `utilities.py`.
* merged `utilities.py` functions used.