fix code format, add methods