Remove legacy code

Use basename instead of strrpos