ugly code spike for creating record and dataplan