added some consts, some cleanup

Signed-off-by: Michal Jarzabek<stiopa@gmail.com>