added tasks to manage actions in a more reasonable way, refactored some code to have better positionining of singleton variables2