some fine tunning, logs and such