cleanup code related to replacefkey and additional work on billing section