more constness and buffers
constness and use string where appropriate