Refactoring, code improvement

Now we're going in a direction that I want.