Cleaning up code part II

Edited by skimdog

additional cleaning; nothing progressive yet