incorporated review comments - double buffer, interface and some cleanup