Reduce code complexity by removing unused logic