various functionality and fixes