Some refactor (doesn't work now, though)