Improved: Refactoring some codes