lesser code and general cleanup