Reorganized source code a bit.