cleaning up the code

making some defs