Fix indentation
Move logics to remove suffix to another function (single responsibility principle)