moved defs to own file
small refactr
erge