moved duplicate code for margin, height, width into one method.