Almost final version. Approaches with triggers will be merged in another project.