v4 update, refactor
compiled on idea