some cleanup/simplification