Some things was transferred from @eternicode repo