changes, tweaking and cleanup