Some refactoring done