Some refactoring

Thank you.