Some refactoring were done