Source refactoring

Modify the source code for better readability.