Large cleanup, some implementations. #1