fixed definitions/changed imports/refactor