Some code organization, documentation