added consts, cleanup
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>