added custom command mapping, fixed bug with journal function, moved commands to local functions