Remove after option, improve code