moved defs to relevant files