helpers code clean up
bug fixing