major code cleanup, try to fix travis