more simplification and cleanup