Modified according to beets coding standards and license