Custom style on profile options page

It works on a standard profile page (your profile / Profile) without other plugins installed.

Other plugins may affect the overall result. I think code can be improved, if some one knows how please give it a go.enter image description here

function better_profile_page($buffer) {
        global $pagenow;
            if ($pagenow == 'profile.php' || $pagenow == 'users.php' || $pagenow == 'user-edit.php') {
                $form_start="#<form id="your-profile" action="".esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ).'" method="post">#';
                $new_form_start="<form id="your-profile" action="".esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ).'" method="post"><div id="normal-sortables" class="meta-box-sortables ui-sortable">
                <div id="poststuff" class="metabox-holder has-right-sidebar">
                    <div id="post-body">
                        <div id="post-body-content" style="margin-right: 0 !important;">
                            <div id="normal-sortables" class="meta-box-sortables ui-sortable">';
                $buffer=preg_replace($form_start, $new_form_start ,$buffer,1);

                $h3_open_a="#<h3>#";
                $buffer=preg_replace($h3_open_a,'<div id="namepage" class="postbox "><h3 style="cursor: default !important;">',$buffer,1);

                $h3_close="#</h3>#";
                $buffer=preg_replace($h3_close,'</h3><div class="inside">',$buffer,1);

                $h3_open_b = '#<h3>#';
                $buffer=preg_replace($h3_open_b,'</div></div><div id="namepage" class="postbox "><h3 style="cursor: default !important;">',$buffer);

                $submit_button = '#<p class="submit">#';
                $buffer=preg_replace($submit_button,'<p class="submit" style="float: left ! important; padding: 12px ! important;">',$buffer);

                $form_close="#</form>#";
                $new_form_close="</div></div></div></form>";
                $buffer=preg_replace($form_close, $new_form_close ,$buffer,1);
            }
            return $buffer;
    }
    function edit_profile_page_start() { 
            ob_start("better_profile_page"); 
    }
    function edit_profile_page_end() { 
            ob_end_flush(); 
    }
    add_action('admin_head', 'edit_profile_page_start');
    add_action('admin_footer', 'edit_profile_page_end');