Add unitests. Add singleton decorator