massive code improvement using a very powerful singleton pattern (selfwritten ofc)