Fix indentation issue and move category update to before properties