a little cleanup

*fixed a few warnings
*factored out a few constants