small speed up
format
small fix & refactoring & formatting