made pad and marg classes more modular