Initial rework.

Feel free to comment.