Code review and cleanup/simplification