Refactoring

Clean up the codes.