- refactor code with @virudson