Define interface and fix some shit