reformate code and method