refactoring on some elements