Overall code cleanup

Overall code cleanup