minor updates, refractoring, logs