refactoring so its more modular and uses BEM