migration to postgresql + layout improvements + fixes for pagination