cleaning up and some minor fix